package com.isaac.edu.controller;

import com.isaac.edu.pojo.Account;
import com.isaac.edu.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/Account")
public class AccountController {

    /**
     * spring容器和springMvc容器是有层次的
     * spring容器：service + dao 对象
     * springMvc容器: controller 对象
     */


    @Autowired
    private AccountService accountService;

    @RequestMapping("/queryAll")
    @ResponseBody
    public List<Account> queryAll() throws Exception {
        return accountService.queryAccountList();
    }



}
